//
//  TKLtextFiled.m
//  tuiguang
//
//  Created by wxt on 2018/8/23.
//  Copyright © 2018年 wxt. All rights reserved.
//

#import "TKLtextFiled.h"

@implementation TKLtextFiled
+(instancetype)FiledWithFrame:(CGRect)frame
                         text:(NSString *)text
                    textColor:(UIColor *)textColor
                         font:(UIFont *)font
                textAlignment:(NSTextAlignment)textAlignment
              backgroundColor:(UIColor *)bgColor
                
{
    TKLtextFiled * tklFiled = [[TKLtextFiled alloc]initWithFrame:frame];
    
    tklFiled.clearButtonMode=UITextFieldViewModeWhileEditing;
    tklFiled.placeholder = text;
    tklFiled.attributedPlaceholder = [[NSAttributedString alloc] initWithString:text attributes:@{NSForegroundColorAttributeName: JhColor(208, 208, 208)}];
    tklFiled.textColor = textColor;
    tklFiled.font = font;
    tklFiled.textAlignment = textAlignment;
      tklFiled.tintColor = JhColor(208,208,208);
    tklFiled.backgroundColor = bgColor;
    tklFiled.layer.masksToBounds = YES;
    tklFiled.layer.cornerRadius = 5;
    return tklFiled;
}
+(instancetype)FiledWithFrame1:(CGRect)frame
                         text:(NSString *)text
                    textColor:(UIColor *)textColor
                         font:(UIFont *)font
                textAlignment:(NSTextAlignment)textAlignment
              backgroundColor:(UIColor *)bgColor
      

{
    TKLtextFiled * tklFiled = [[TKLtextFiled alloc]initWithFrame:frame];
    
    tklFiled.placeholder = text;
    tklFiled.attributedPlaceholder = [[NSAttributedString alloc] initWithString:tklFiled.placeholder attributes:@{NSForegroundColorAttributeName: [UIColor grayColor]}];
   
    tklFiled.tintColor = JhColor(255, 23, 83);
    tklFiled.textColor = textColor;
    tklFiled.font = font;
    tklFiled.textAlignment = textAlignment;
    
    tklFiled.backgroundColor = bgColor;
    
    
    
    return tklFiled;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
